#include "ground.hpp"

Ground::Ground():Object(ObjType::GROUND){
    SetName(Names::GROUND);
}

void Ground::Add(Object* obj){
    if(obj->GetType()==ObjType::CREATURE)
        SDL_Log("creature can't put into ground");
    else
        _objects.push_back(obj);
}

void Ground::Remove(int idx){
    _objects.erase(_objects.begin()+idx);
}

bool Ground::Empty() const{
    return _objects.empty();
}

int Ground::Size() const{
    return _objects.size();
}

vector<Object*>& Ground::GetObjects(){
    return _objects;
}

void Ground::Draw(){
    Object::Draw();
    if(!_objects.empty())
        _objects.back()->Draw();
}
